/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.poss.api.domain;

import java.util.Date;
import javax.persistence.*;

/**
 *
 * @author sampath  
 */
@Entity
public class Sale {
    private long saleId;
    private Date soldDate;
    private long soldQty;
    private User soldUser;
    private Items soldItem;
    private Customer broughtCustomer;

    @ManyToOne
    @JoinColumn(name="customerId")
    public Customer getBroughtCustomer() {
        return broughtCustomer;
    }

    public void setBroughtCustomer(Customer broughtCustomer) {
        this.broughtCustomer = broughtCustomer;
    }

    @Id
    @GeneratedValue
    public long getSaleId() {
        return saleId;
    }

    public void setSaleId(long saleId) {
        this.saleId = saleId;
    }

    @Temporal(TemporalType.TIMESTAMP)
    public Date getSoldDate() {
        return soldDate;
    }

    public void setSoldDate(Date soldDate) {
        this.soldDate = soldDate;
    }

    @ManyToOne
    @JoinColumn(name="itemId")
    public Items getSoldItem() {
        return soldItem;
    }

    public void setSoldItem(Items soldItem) {
        this.soldItem = soldItem;
    }

    public long getSoldQty() {
        return soldQty;
    }

    public void setSoldQty(long soldQty) {
        this.soldQty = soldQty;
    }

    @ManyToOne
    @JoinColumn(name="userId")
    public User getSoldUser() {
        return soldUser;
    }

    public void setSoldUser(User soldUser) {
        this.soldUser = soldUser;
    }

   
}
